package com.anlogic.sdk.openocd.model;

import com.google.gson.Gson;

public class JtagDevice {
	private String name;

	private String idCode;

	private String irLength;

	private boolean isFPGA;

	public JtagDevice(String name, String idCode, String irLength, boolean isFPGA) {
		this.name = name;
		this.idCode = idCode;
		this.irLength = irLength;
		this.isFPGA = isFPGA;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getIdCode() {
		return this.idCode;
	}

	public void setIdCode(String idCode) {
		this.idCode = idCode;
	}

	public String getIRLength() {
		return this.irLength;
	}

	public void setIRLength(String irLength) {
		this.irLength = irLength;
	}

	public boolean isFPGA() {
		return this.isFPGA;
	}

	public void setFPGA(boolean en) {
		this.isFPGA = en;
	}
	
	public String toJsonString() {
		Gson gson = new Gson();
		return gson.toJson(this);
	}
	
	public JtagDevice readJsonString(String json) {
		Gson gson = new Gson();
		return gson.fromJson(json, JtagDevice.class);
	}
}
